package com.lcg.rocket.mqlistener;

import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @author: LCG
 * @date: 2023-01-12 13:49:20
 *
 *
 * @description:
 **/
@Component
//@RocketMQMessageListener(topic = "TEST-15",consumerGroup = "TEST-125",consumeThreadMax = 1
        //selectorExpression = "A1", //用来做tag过滤，但是本代码没有达到应有的效果（）
//selectorType = SelectorType.TAG
//)
public class MqListener02 implements RocketMQListener<MessageExt> {

    @Override
    public void onMessage(MessageExt s) {

        System.out.println(Thread.currentThread().getId()+"-----Rocket简单消费信息1----"+new String(s.getBody()));
    }
}
